package com.stock_t.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.stock_t.entity.StockTTransaction;
import com.stock_t.mapper.StockTTransactionMapper;
import com.stock_t.service.StockTTransactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

@Service
public class StockTTransactionServiceImpl extends ServiceImpl<StockTTransactionMapper, StockTTransaction> implements StockTTransactionService {

    @Autowired
    private StockTTransactionMapper stockTTransactionMapper;

    @Override
    public BigDecimal getTotalTProfitByDateAndStock(Date transactionDate, String stockCode) {
        return stockTTransactionMapper.getTotalTProfitByDateAndStock(transactionDate, stockCode);
    }

    @Override
    public BigDecimal getTotalTProfitByStockCode(String stockCode) {
        return stockTTransactionMapper.getTotalTProfitByStockCode(stockCode);
    }
}